﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace MrPP.SerriedCabinet
{
    public class CheckBoxView : CheckViewAbstract
    {

       // [SerializeField]
       // private CheckModel _model;

      

        public void Start()
        {
           // Debug.LogError("================");
           // _model.onState += doState;

           // _model.onArchives += onArchives;
         //   _model.onItems += onItems;
          //  _model.onCheckList += onCheckList;
            // refresh();
        }

       



     

        private void doState(CheckPost.State last, CheckPost.State next)
        {
           


        }

        public override void onTab(int oldValue, int newValue)
        {
        }

        public override void onPage(int oldValue, int newValue)
        {
        }

        public override void onState(CheckPost.State oldValue, CheckPost.State newValue)
        { /*
            if ((last == CheckPost.State.Close|| last == CheckPost.State.Loading) && next == CheckPost.State.Running )
            {
                CheckBoxManager.Instance.open();
            }
            else if (last == CheckPost.State.Running && next == CheckPost.State.Close)
            {

                CheckBoxManager.Instance.close();
            }*/
        }

        public override void onItems(CabinetGroup.ItemData[] items)
        {

            CellCheckManager.Instance.setup(items); 
            //CheckBoxManager.Instance.setup(items);
        }

        public override void onWaitPage(int oldValue, int newValue)
        {
        }

        public override void onCheckPage(int oldValue, int newValue)
        {
        }

        public override void onOtherPage(int oldValue, int newValue)
        {
        }

        public override void onCheckList(List<string> list)
        {
            CellCheckManager.Instance.check(list);
           // CheckBoxManager.Instance.check(list);
        }
    }
}